<include file="public@header"/>
</head>
<body>
<div class="wrap js-check-wrap">
 
    <div class="row">

        <div class="col-md-12">
            <form class="well form-inline" method="post" action="{:url('store/admin_store/tj_order')}">
                结算状态:
                <select class="form-control" name="is_jiesuan" style="width: 140px;">
                    <option value="0" <eq name="is_jiesuan" value="0">selected</eq>>全部</option>
                    <option value="1" <eq name="is_jiesuan" value="1">selected</eq>>已结算</option>
                    <option value="2" <eq name="is_jiesuan" value="2">selected</eq>>未结算</option>
                </select>
                订单号:
                <input type="text" class="form-control" name="order_no" style="width: 200px;" value="{$order_no|default=''}" placeholder="请输入订单号">
                关联店铺:
                <select class="form-control" name="store_id" style="width: 140px;">
                    <option value="0" <eq name="store_id" value="0">selected</eq>>全部</option>
                    <foreach name="store_list" item="v">
                        <option value="{$v.id}" <eq name="store_id" value="$v['id']">selected</eq>>{$v.store_name}</option>
                    </foreach>
                </select>
                <button class="btn btn-primary">搜索</button>
            </form>
            <div class="tab-content">
                <table class="table table-hover table-bordered">
                    <thead>
                    <tr>
                        <th>订单号</th>
                        <th>关联店铺</th>
                      <th>用户</th>
                        <th>支付价格</th>
                        <th>退款金额</th>
                        <th>下单时间</th>
                        <th>订单状态</th>
                        <th>结算金额</th>
                        <th>结算状态</th>
                        <th>操作</th>
                    </tr>
                    </thead>
                    <tbody>
                    <empty name="tj_order">
                    <tr>
                        <td colspan="9" style="text-align: center">暂无推荐订单</td>
                    </tr>
                    </empty>
                    <notempty name="tj_order">
                        <foreach name="tj_order" item="vo">

                            <tr>
                            <td>{$vo.order_no}</td>
                              <td>
                              		<php>$store_info=cmf_get_store($vo['shop_id']);</php>
                                {$store_info.store_name}
                              </td>
                            <td>
                                {$vo.user_name}
                            </td>
                            <td>￥{$vo.pay_money}+{$vo.pay_point}积分</td>
                            <td>￥{$vo.refund_require_money}+{$vo.refund_require_score}积分</td>

                            <td>{:date('Y-m-d H:i:s',$vo['create_time'])}</td>
                                <td>【{:cmf_get_order_status($vo.order_status)}】</td>
                             <td>
                                 <php>
                                    $money=( $vo['pay_money']-$vo['refund_require_money'])*0.2;
                                 </php>
                                 ￥{$money}
                             </td>
                            <td>
                                <eq name="vo['order_status']" value="13"> 已结算</eq>
                                <neq name="vo['order_status']" value="13"> 未结算</neq>
                            </td>
                                <td>
                                    <php>
                                        $data=order_status($vo['order_id']);
                                    </php>
                                    <eq name="data['code']" value="1">
                                        <a href="{:url('store/admin_store/order_jiesuan',array('id'=>$vo['order_id']))}" class="js-ajax-dialog-btn btn btn-success">{$data.msg}</a>
                                    </eq>
                                    <eq name="data['code']" value="0">
                                        <button class="btn btn-error">{$data.msg}</button>
                                    </eq>
                                </td>

                            </tr>
                        </foreach>
                    </notempty>
                    </tbody>
                </table>
<ul class="pagination">{$pages}</ul>
            </div>
        </div>
    </div>
</div>
<script type="text/javascript" src="__STATIC__/js/admin.js"></script>
</body>
</html>